#ifndef FFVRENDER_H
#define FFVRENDER_H

#include"decoder/ffvdecoder.h"
#include<chrono>
#include<atomic>
extern "C"{
#include"libavformat/avformat.h"
}

class FFTimer;
class FFVFrameQueue;
class FFPlayerContext;
class FFGLRenderWidget;

class FFVRender
{
public:
    FFVRender();
    ~FFVRender();

    void init(FFVDecoder* vDecoder_, FFVFrameQueue* frmQueue_,FFGLRenderWidget* renderWidget_);
    void start();
    void stop();
    void pause();
    void wait();
    void close();
    void setSpeed(float speed);

    void wakeAllThread();
private:
    void initTimer();

private:
    FFVDecoder* vDecoder = nullptr;
    FFVFrameQueue* frmQueue = nullptr;

    FFTimer* timer = nullptr;
    FFGLRenderWidget* renderWidget = nullptr;
};

#endif // FFVRENDER_H
